"auto";
function get_over(){
    let object = text("已加载全部评论").findOnce();
    if (object != null) {     
    return true ; //到底了
        
    } else {
    return false; //没到底
    }
}
function swpdown(){
    sleep(2000);
    swipe(520,1800 ,520 ,1400,500 );
    sleep(1000);
    swipe(520,1910 ,520 ,5,1500 );
    sleep(2000);

}
function over_test(get_over){
    let flag=get_over();
    if (flag==true){
        toast("到底了，停止");
       // break;
    }else{
        toast("开始下一页");
        swpdown();  
    }
}
function back_page(){
    click(500, 1280);    
}
//id("btn_follow").findOnce().click();
 while(true){
    
//     sleep(2000);
//     
//    // over_test(get_over);
    try{
        id("recycler_view").className("androidx.recyclerview.widget.RecyclerView").scrollable(true).findOne().children().forEach(child => {
        var target = child.findOne(id("btn_follow"));
        target.click();
        sleep(4000);
        }); 
        swpdown(); 
    }catch(error){
        sleep(4000);
        continue;  
    }
    

 }